/**
 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package fr.smile.liferay.portlet.news.service;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.util.ClassLoaderProxy;

/**
 * The utility for the news entry remote service. This utility wraps {@link fr.smile.liferay.portlet.news.service.impl.NewsEntryServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
 *
 * <p>
 * Never modify this class directly. Add custom service methods to {@link fr.smile.liferay.portlet.news.service.impl.NewsEntryServiceImpl} and rerun ServiceBuilder to regenerate this class.
 * </p>
 *
 * <p>
 * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
 * </p>
 *
 * @author Brian Wing Shun Chan
 * @see NewsEntryService
 * @see fr.smile.liferay.portlet.news.service.base.NewsEntryServiceBaseImpl
 * @see fr.smile.liferay.portlet.news.service.impl.NewsEntryServiceImpl
 * @generated
 */
public class NewsEntryServiceUtil {
	public static java.util.List<fr.smile.liferay.portlet.news.model.NewsEntry> findUnread(
		long userId, java.util.Map<java.lang.Long, long[]> scopes, int start,
		int end) throws com.liferay.portal.kernel.exception.SystemException {
		return getService().findUnread(userId, scopes, start, end);
	}

	public static int countUnread(long userId,
		java.util.Map<java.lang.Long, long[]> scopes)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().countUnread(userId, scopes);
	}

	public static java.util.List<fr.smile.liferay.portlet.news.model.NewsEntry> findAll(
		long classNameId, long classPK, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().findAll(classNameId, classPK, start, end);
	}

	public static int countAll(long classNameId, long classPK)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().countAll(classNameId, classPK);
	}

	public static fr.smile.liferay.portlet.news.model.NewsEntry addEntry(
		long userId, long classNameId, long classPK, java.lang.String title,
		java.lang.String description, java.lang.String content,
		java.util.Date displayDate, java.util.Date expirationDate)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService()
				   .addEntry(userId, classNameId, classPK, title, description,
			content, displayDate, expirationDate);
	}

	public static fr.smile.liferay.portlet.news.model.NewsEntry updateEntry(
		long entryId, java.lang.String title, java.lang.String description,
		java.lang.String content, java.util.Date displayDate,
		java.util.Date expirationDate)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService()
				   .updateEntry(entryId, title, description, content,
			displayDate, expirationDate);
	}

	public static void deleteEntry(long entryId)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		getService().deleteEntry(entryId);
	}

	public static void clearService() {
		_service = null;
	}

	public static NewsEntryService getService() {
		if (_service == null) {
			Object obj = PortletBeanLocatorUtil.locate(ClpSerializer.SERVLET_CONTEXT_NAME,
					NewsEntryService.class.getName());
			ClassLoader portletClassLoader = (ClassLoader)PortletBeanLocatorUtil.locate(ClpSerializer.SERVLET_CONTEXT_NAME,
					"portletClassLoader");

			ClassLoaderProxy classLoaderProxy = new ClassLoaderProxy(obj,
					portletClassLoader);

			_service = new NewsEntryServiceClp(classLoaderProxy);

			ClpSerializer.setClassLoader(portletClassLoader);
		}

		return _service;
	}

	public void setService(NewsEntryService service) {
		_service = service;
	}

	private static NewsEntryService _service;
}